﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema
	id="javaScriptEngineSwitcherConfiguration"
	targetNamespace="http://tempuri.org/JavaScriptEngineSwitcher.Configuration.xsd"
	elementFormDefault="qualified"
	xmlns="http://tempuri.org/JavaScriptEngineSwitcher.Configuration.xsd"
	xmlns:mstns="http://tempuri.org/JavaScriptEngineSwitcher.Configuration.xsd"
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="jsEngineSwitcher">
		<xs:annotation>
			<xs:documentation>Configuration settings of JavaScript Engine Switcher</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:all>
				<xs:element name="core" type="CoreConfiguration_SchemaType" minOccurs="0" maxOccurs="1" />
				<xs:element name="msie" type="MsieConfiguration_SchemaType" minOccurs="0" maxOccurs="1" />
				<xs:element name="v8" type="V8Configuration_SchemaType" minOccurs="0" maxOccurs="1" />
				<xs:element name="jurassic" type="JurassicConfiguration_SchemaType" minOccurs="0" maxOccurs="1" />
				<xs:element name="jint" type="JintConfiguration_SchemaType" minOccurs="0" maxOccurs="1" />
			</xs:all>
		</xs:complexType>
	</xs:element>

	<!-- Simple types -->
	<xs:simpleType name="Boolean_SchemaType">
		<xs:restriction base="xs:NMTOKEN">
			<xs:enumeration value="true" />
			<xs:enumeration value="false" />
		</xs:restriction>
	</xs:simpleType>
	<!-- /Simple types -->

	<!-- Core configuration settings -->
	<xs:complexType name="CoreConfiguration_SchemaType">
		<xs:annotation>
			<xs:documentation>Configuration settings of core</xs:documentation>
		</xs:annotation>
		<xs:all>
			<xs:element name="engines" type="JsEngineRegistrationList_SchemaType" minOccurs="0" maxOccurs="1" />
		</xs:all>
		<xs:attribute name="defaultEngine" type="xs:string" use="optional" default="">
			<xs:annotation>
				<xs:documentation>Name of default JavaScript engine</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="JsEngineRegistrationList_SchemaType">
		<xs:annotation>
			<xs:documentation>List of registered JavaScript engines</xs:documentation>
		</xs:annotation>
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="add" type="AddJsEngineRegistration_SchemaType" />
			<xs:element name="remove" type="RemoveJsEngineRegistration_SchemaType" />
			<xs:element name="clear" type="ClearJsEngineRegistration_SchemaType" />
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="AddJsEngineRegistration_SchemaType">
		<xs:annotation>
			<xs:documentation>Adds JavaScript engine registration</xs:documentation>
		</xs:annotation>
		<xs:attribute name="name" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation>JavaScript engine name</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="type" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation>JavaScript engine .NET-type name</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="RemoveJsEngineRegistration_SchemaType">
		<xs:annotation>
			<xs:documentation>Removes JavaScript engine registration</xs:documentation>
		</xs:annotation>
		<xs:attribute name="name" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation>JavaScript engine name</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ClearJsEngineRegistration_SchemaType">
		<xs:annotation>
			<xs:documentation>Removes all JavaScript engine registrations, that specified above</xs:documentation>
		</xs:annotation>
	</xs:complexType>
	<!--/ Core configuration settings -->

	<!-- MSIE configuration settings -->
	<xs:complexType name="MsieConfiguration_SchemaType">
		<xs:annotation>
			<xs:documentation>Configuration settings of MSIE JavaScript engine</xs:documentation>
		</xs:annotation>
		<xs:attribute name="enableDebugging" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to enable script debugging features (only works in the `ChakraIeJsRt` and `ChakraEdgeJsRt` modes)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="engineMode" use="optional" default="Auto">
			<xs:annotation>
				<xs:documentation>JavaScript engine mode</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="Auto">
						<xs:annotation>
							<xs:documentation>Automatically selects the most modern JavaScript engine from available on the machine</xs:documentation>
						</xs:annotation>
					</xs:enumeration>
					<xs:enumeration value="Classic">
						<xs:annotation>
							<xs:documentation>Classic MSIE JavaScript engine (supports ECMAScript 3 with possibility of using the ECMAScript 5 Polyfill and the JSON2 library). Requires Internet Explorer 6 or higher on the machine.</xs:documentation>
						</xs:annotation>
					</xs:enumeration>
					<xs:enumeration value="ChakraActiveScript">
						<xs:annotation>
							<xs:documentation>ActiveScript version of Chakra JavaScript engine (supports ECMAScript 3 with possibility of using the ECMAScript 5 Polyfill and the JSON2 library). Requires Internet Explorer 9 or higher on the machine.</xs:documentation>
						</xs:annotation>
					</xs:enumeration>
					<xs:enumeration value="ChakraIeJsRt">
						<xs:annotation>
							<xs:documentation>“IE” JsRT version of Chakra JavaScript engine (supports ECMAScript 5). Requires Internet Explorer 11 or Microsoft Edge on the machine.</xs:documentation>
						</xs:annotation>
					</xs:enumeration>
					<xs:enumeration value="ChakraEdgeJsRt">
						<xs:annotation>
							<xs:documentation>“Edge” JsRT version of Chakra JavaScript engine (supports ECMAScript 5). Requires Microsoft Edge on the machine.</xs:documentation>
						</xs:annotation>
					</xs:enumeration>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="useEcmaScript5Polyfill" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to use the ECMAScript 5 Polyfill</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="useJson2Library" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to use the JSON2 library</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!--/ MSIE configuration settings -->

	<!-- V8 configuration settings -->
	<xs:complexType name="V8Configuration_SchemaType">
		<xs:annotation>
			<xs:documentation>Configuration settings of V8 JavaScript engine</xs:documentation>
		</xs:annotation>
		<xs:attribute name="enableDebugging" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to enable script debugging features (allows a TCP/IP-based debugging)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="debugPort" use="optional" default="9222">
			<xs:annotation>
				<xs:documentation>TCP/IP port on which to listen for a debugger connection</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="0" />
					<xs:maxInclusive value="65535" />
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="disableGlobalMembers" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to disable global members</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="maxNewSpaceSize" use="optional" default="0">
			<xs:annotation>
				<xs:documentation>Maximum size of the new object heap in mebibytes</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="0" />
					<xs:maxInclusive value="2147483647" />
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="maxOldSpaceSize" use="optional" default="0">
			<xs:annotation>
				<xs:documentation>Maximum size of the old object heap in mebibytes</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="0" />
					<xs:maxInclusive value="2147483647" />
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="maxExecutableSize" use="optional" default="0">
			<xs:annotation>
				<xs:documentation>Maximum size of the executable code heap in mebibytes</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="0" />
					<xs:maxInclusive value="2147483647" />
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<!--/ V8 configuration settings -->

	<!-- Jurassic configuration settings -->
	<xs:complexType name="JurassicConfiguration_SchemaType">
		<xs:annotation>
			<xs:documentation>Configuration settings of Jurassic JavaScript engine</xs:documentation>
		</xs:annotation>
		<xs:attribute name="enableDebugging" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to enable script debugging features (allows a generation of debug information)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="enableIlAnalysis" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to disassemble any generated IL and store it in the associated function</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="strictMode" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to allow run the script in strict mode</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!--/ Jurassic configuration settings -->

	<!-- Jint configuration settings -->
	<xs:complexType name="JintConfiguration_SchemaType">
		<xs:annotation>
			<xs:documentation>Configuration settings of Jint JavaScript engine</xs:documentation>
		</xs:annotation>
		<xs:attribute name="allowDebuggerStatement" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to allow the `debugger` statement to be called in a script</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="enableDebugging" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to enable debug mode</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="maxRecursionDepth" use="optional" default="-1">
			<xs:annotation>
				<xs:documentation>Maximum allowed depth of recursion:
 -1 - recursion without limits;
  N - one scope function can be called no more than N times.</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="-1" />
					<xs:maxInclusive value="2147483647" />
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="maxStatements" use="optional" default="0">
			<xs:annotation>
				<xs:documentation>Maximum number of statements</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="0" />
					<xs:maxInclusive value="2147483647" />
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="strictMode" type="Boolean_SchemaType" use="optional" default="false">
			<xs:annotation>
				<xs:documentation>Flag for whether to allow run the script in strict mode</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="timeout" use="optional" default="0">
			<xs:annotation>
				<xs:documentation>Number of milliseconds to wait before the script execution times out</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="0" />
					<xs:maxInclusive value="2147483647" />
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<!--/ Jint configuration settings -->
</xs:schema>